
var redraw, g, renderer;

/* only do all this when document has finished loading (needed for RaphaelJS) */
function drawGraph(transitions) {
    
	var width = 640;
	var height = 490;
	
	// construct graph nodes/edges
	g = new Graph();
	var i=0;
	for (i=0;i<=transitions.length-1;i=i+4)
	{
		g.addEdge(transitions[i+2],transitions[i+3],{ directed : true, label : transitions[i+1]});
	}
	
	// render graph
	var layouter = new Graph.Layout.Spring(g);
	renderer = new Graph.Renderer.Raphael('canvas', g, width, height);
};